const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.BIGINT,
      allowNull: false,
      defaultValue: null,
      comment: "主键",
      primaryKey: true,
      field: "id",
      autoIncrement: false
    },
    config_id: {
      type: DataTypes.BIGINT,
      allowNull: false,
      defaultValue: null,
      comment: "关联的配置ID",
      primaryKey: false,
      field: "config_id",
      autoIncrement: false
    },
    column_name: {
      type: DataTypes.CHAR,
      allowNull: true,
      defaultValue: null,
      comment: null,
      primaryKey: false,
      field: "column_name",
      autoIncrement: false
    },
    column_type: {
      type: DataTypes.CHAR,
      allowNull: true,
      defaultValue: null,
      comment: null,
      primaryKey: false,
      field: "column_type",
      autoIncrement: false
    },
    column_length: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null,
      comment: null,
      primaryKey: false,
      field: "column_length",
      autoIncrement: false
    },
    field_name: {
      type: DataTypes.CHAR,
      allowNull: false,
      defaultValue: null,
      comment: "字段名称",
      primaryKey: false,
      field: "field_name",
      autoIncrement: false
    },
    field_type: {
      type: DataTypes.CHAR,
      allowNull: true,
      defaultValue: null,
      comment: "字段类型",
      primaryKey: false,
      field: "field_type",
      autoIncrement: false
    },
    field_sort: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null,
      comment: "字段排序",
      primaryKey: false,
      field: "field_sort",
      autoIncrement: false
    },
    field_comment: {
      type: DataTypes.CHAR,
      allowNull: true,
      defaultValue: null,
      comment: "字段描述",
      primaryKey: false,
      field: "field_comment",
      autoIncrement: false
    },
    max_length: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null,
      comment: null,
      primaryKey: false,
      field: "max_length",
      autoIncrement: false
    },
    is_required: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null,
      comment: "是否必填",
      primaryKey: false,
      field: "is_required",
      autoIncrement: false
    },
    is_show_in_list: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null,
      comment: "是否在列表显示",
      primaryKey: false,
      field: "is_show_in_list",
      autoIncrement: false
    },
    is_show_in_form: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null,
      comment: "是否在表单显示",
      primaryKey: false,
      field: "is_show_in_form",
      autoIncrement: false
    },
    is_show_in_query: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null,
      comment: "是否在查询条件显示",
      primaryKey: false,
      field: "is_show_in_query",
      autoIncrement: false
    },
    query_type: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null,
      comment: "查询方式",
      primaryKey: false,
      field: "query_type",
      autoIncrement: false
    },
    form_type: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null,
      comment: "表单类型",
      primaryKey: false,
      field: "form_type",
      autoIncrement: false
    },
    dict_type: {
      type: DataTypes.CHAR,
      allowNull: true,
      defaultValue: null,
      comment: "字典类型",
      primaryKey: false,
      field: "dict_type",
      autoIncrement: false
    },
    create_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: null,
      comment: "创建时间",
      primaryKey: false,
      field: "create_time",
      autoIncrement: false
    },
    update_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: null,
      comment: "更新时间",
      primaryKey: false,
      field: "update_time",
      autoIncrement: false
    }
  };
  const options = {
    tableName: "gen_field_config",
    comment: "",
    indexes: [{
      name: "config_id",
      unique: false,
      fields: ["config_id"]
    }]
  };
  const GenFieldConfigModel = sequelize.define("gen_field_config_model", attributes, options);
  return GenFieldConfigModel;
};